<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <META http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>Admin for Online Token Sharing Game</title>
  <link rel="stylesheet" type="text/css" href="_/css/mystyle.css">
  <script type="text/javascript" src="_/js/jquery-1.8.2.min.js"></script>
  <script type="text/javascript" src="_/js/myscript.js"></script>
  
  
</head>
<body>
<?php
		
	     require_once("database.php");
		  $username = $_POST['username'];
  		  $password_sha1 = ($_POST['password']);
		  // clear out any existing session that may exist
		  $row=Auth ($user_id,$password);
 	 session_start();
 	 session_destroy();
  	 session_start();

  if ($row) {
    $_SESSION['signed_in'] = true;
    $_SESSION['username'] = $username;
    
  } else {
    $_SESSION['flash_error'] = "Invalid username or password";
    $_SESSION['signed_in'] = false;
    $_SESSION['username'] = null;
    header("Location: /JMJ_test/admin_login.php");
  }
	?>
    
    <p>
    Welcome to Online Token Sharing game !!
    </p>
</body>

</html>